AS=/usr/local/mips-cross/bin/mipsel-elf-as
CC=/usr/local/mips-cross/bin/mipsel-elf-gcc
LD=/usr/local/mips-cross/bin/mipsel-elf-ld
OBJCOPY=/usr/local/mips-cross/bin/mipsel-elf-objcopy
OBJDUMP=/usr/local/mips-cross/bin/mipsel-elf-objdump

all:
	$(AS) -mips1 set.S -o set.o -EL 
	$(LD) -mips1 -T ../../lib/default.ld set.o -o set.elf -EL
	$(OBJCOPY) -j .startup.bootvec -j .startup -O binary set.elf set.bin
	hexdump -e "1/4 \"%08x\n\"" set.bin -v > set.hex
	cat ../../lib/nops.hex >> set.hex
	
dump:
	$(OBJDUMP) -j .startup.bootvec -j .startup -D set.elf

symbols:
	$(OBJDUMP) -t set.elf

sections:
	$(OBJDUMP) -h set.elf

clean:
	rm -f set.bin set.elf set.hex set.o
